gsk: Make GskBlendMode enumeration public
authorEmmanuele Bassi <ebassi@gnome.org>
Fri, 1 Jul 2016 11:02:43 +0000 (12:02 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 18 Oct 2016 10:49:07 +0000 (11:49 +0100)
gsk/gskenums.h
gsk/gskglrenderer.c

index b831d4903ea7fe9b7dc7af6dffe773bbdc48be6c..9ccfc9504e4e85de2d78a55033768769d22581a0 100644 (file)
@@ -43,4 +43,43 @@ typedef enum {
   GSK_SCALING_FILTER_TRILINEAR
 } GskScalingFilter;
 
+/**
+ * GskBlendMode:
+ * @GSK_BLEND_MODE_DEFAULT: The default blend mode, which specifies no blending
+ * @GSK_BLEND_MODE_MULTIPLY: The source color is multiplied by the destination
+ *   and replaces the destination
+ * @GSK_BLEND_MODE_SCREEN:
+ * @GSK_BLEND_MODE_OVERLAY: ...
+ * @GSK_BLEND_MODE_DARKEN: ...
+ * @GSK_BLEND_MODE_LIGHTEN: ...
+ * @GSK_BLEND_MODE_COLOR_DODGE: ...
+ * @GSK_BLEND_MODE_COLOR_BURN: ...
+ * @GSK_BLEND_MODE_HARD_LIGHT: ...
+ * @GSK_BLEND_MODE_SOFT_LIGHT: ...
+ * @GSK_BLEND_MODE_DIFFERENCE: ...
+ * @GSK_BLEND_MODE_EXCLUSION: ...
+ *
+ * The blend modes available for render nodes.
+ *
+ * The implementation of each blend mode is deferred to the
+ * rendering pipeline.
+ *
+ * Since: 3.22
+ */
+typedef enum {
+  GSK_BLEND_MODE_DEFAULT = 0,
+
+  GSK_BLEND_MODE_MULTIPLY,
+  GSK_BLEND_MODE_SCREEN,
+  GSK_BLEND_MODE_OVERLAY,
+  GSK_BLEND_MODE_DARKEN,
+  GSK_BLEND_MODE_LIGHTEN,
+  GSK_BLEND_MODE_COLOR_DODGE,
+  GSK_BLEND_MODE_COLOR_BURN,
+  GSK_BLEND_MODE_HARD_LIGHT,
+  GSK_BLEND_MODE_SOFT_LIGHT,
+  GSK_BLEND_MODE_DIFFERENCE,
+  GSK_BLEND_MODE_EXCLUSION
+} GskBlendMode;
+
 #endif /* __GSK_TYPES_H__ */
index 2b919a3c4e586a791ec609d4caca27c1c54e9845..6c634ad79510b07cc36805913ff51ed502f408f2 100644 (file)
 
 #include <epoxy/gl.h>
 
-typedef enum {
-  GSK_BLEND_MODE_NONE,
-
-  GSK_BLEND_MODE_MULTIPLY
-} GskBlendMode;
-
 typedef struct {
   guint vao_id;
   guint buffer_id;
@@ -772,7 +766,7 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
   item.opaque = gsk_render_node_is_opaque (node);
   item.opacity = gsk_render_node_get_opacity (node);
 
-  item.blend_mode = parent != NULL ? GSK_BLEND_MODE_MULTIPLY : GSK_BLEND_MODE_NONE;
+  item.blend_mode = parent != NULL ? GSK_BLEND_MODE_MULTIPLY : GSK_BLEND_MODE_DEFAULT;
 
   /* GL objects */
   item.render_data.vao_id = self->vao_id;